﻿@*@model IEnumerable<UscSunShine.Models.Post>*@
@model PagedList.IPagedList<UscSunShine.Models.Post>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />

@{
    ViewBag.Title = "政策法规";
}
<p>
    @Html.ActionLink("新建", "Create", null, new { @class = "btn btn-primary" })
</p>
<hr />
<h2>政策法规</h2>


<table class="table table-hover">
    <tr>
        @*<th>
                @Html.DisplayNameFor(model => model.Department.Name)
            </th>*@
        <th>
            @Html.DisplayNameFor(model => model.SingleOrDefault().Title)
        </th>
        @*<th>
                @Html.DisplayNameFor(model => model.Content)
            </th>*@
        <th>
            @Html.DisplayNameFor(model => model.SingleOrDefault().InputDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.SingleOrDefault().ViewTimes)
        </th>
        @*<th>
                @Html.DisplayNameFor(model => model.PostCategory)
            </th>*@
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            @*<td>
                    @Html.DisplayFor(modelItem => item.Department.Name)
                </td>*@
            <td>
                @Html.ActionLink(item.Title, "Details", new { id = item.ID })
            </td>
            @*<td>
                    @Html.DisplayFor(modelItem => item.Content)
                </td>*@
            <td>
                @Html.DisplayFor(modelItem => item.InputDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ViewTimes)
            </td>
            @*<td>
                    @Html.DisplayFor(modelItem => item.PostCategory)
                </td>*@
            <td>
                @Html.ActionLink("编辑", "Edit", new { id = item.ID }, new { @class = "btn btn-primary btn-sm" })
                @Html.ActionLink("查看", "Details", new { id = item.ID }, new { @class = "btn btn-info btn-sm" })
                @Html.ActionLink("删除", "Delete", new { id = item.ID }, new { @class = "btn btn-danger btn-sm" })
            </td>
        </tr>
    }

</table>

<br />
第 @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) 页，共 @Model.PageCount 页
@Html.PagedListPager(Model, page => Url.Action("Index", new { page }))
